package com.lagou.edu.controller.dao;

import com.lagou.edu.pojo.LagouAuthCode;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author zjy
 */
public interface LagouAuthCodeDao extends JpaRepository<LagouAuthCode,Long> {

    /**
     * 根据email
     * @param email
     * @return
     */
    List<LagouAuthCode> findLagouAuthCodeByEmailOrderByExpiretimeDesc(String email);

    /**
     * 根据email和code查询
     * @param email
     * @param code
     * @return
     */
    List<LagouAuthCode> findLagouAuthCodeByEmailAndCodeOrderByExpiretimeDesc(String email,String code);
}
